<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>自适应宽度的正方形</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .box {
            width: 20%;
            height: 0;
            padding-bottom: 20%;
            background-color: red;
        }
    </style>
</head>
<body>
<div class="box">
    <p>自适应宽度正方形</p>
</div>
</body>
</html>
